FROM centos:7 

RUN groupadd kingbase && useradd -g kingbase -m -d /home/kingbase -s /bin/bash kingbase

WORKDIR /home/kingbase

ARG version=V008R006C006B0021

ADD kingbase.tar.gz ./

ADD password ./

ADD docker-entrypoint.sh ./

ADD license.dat ./

RUN chmod +x docker-entrypoint.sh && chown -R kingbase:kingbase /home/kingbase

ENV PATH /home/kingbase/Server/bin:$PATH

ENV DB_VERSION ${version}

ENV SYSTEM_USER system

ENV SYSTEM_PWD 123456

ENV ENCODING UTF8

ENV DATABASE_MODE ORACLE

ENV CASE_SENSITIVE YES

ENV BLOCK_SIZE 8

USER kingbase

EXPOSE 54321

ENTRYPOINT ["/home/kingbase/docker-entrypoint.sh"]
